package com.xxzhy.mypoints;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

/**
 * Created by apple on 2017/12/5.
 */

public class BaseFragment extends Fragment {

    private int type;
    private int[] images = {R.mipmap.a, R.mipmap.b, R.mipmap.c, R.mipmap.d};

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
        View inflate = inflater.inflate(R.layout.fragment_base, null);
        ImageView ivImage = inflate.findViewById(R.id.iv_image);
        if (type == 0) {
            ivImage.setImageResource(images[type]);
        }else if (type ==1){
            ivImage.setImageResource(images[type]);
        }else if (type ==2){
            ivImage.setImageResource(images[type]);
        }else if (type ==3){
            ivImage.setImageResource(images[type]);
        }
        return inflate;

    }

    public void settype(int i) {
        type = i;
    }
}
